Method for accessing banks of DRAM

ABSTRACT

This invention discloses a method for accessing Dynamic Random Access Memory (DRAM) to store and retrieve data words associated with a two dimensional image. The DRAM includes two separate banks, a first bank and a second bank. Each bank is capable of operating in page mode to read and write the data words. The two dimensional image is organized in a two dimensional grid pattern of cells, each cell containing an M by N matrix of pixels. The words associated with each cell occupy one page or less of a bank. Each cell is assigned a particular one of the two banks so that all data words associated with that particular cell are read from and written to one particular page of that particular bank. The assignment of banks to cells is done such that each cell is associated with a different bank than any bordering cell which is also either in the same row or in the same column. There is then read the data words associated with a cell that is composed of a matrix of pixels and is not aligned with the two dimensional grid pattern, but is aligned with pixels in cells in the two dimensional grid pattern.

This is a division of application Ser. No. 08/400,058, filed Mar. 7, 1995 now abandoned.

REFERENCE TO RELATED APPLICATIONS

This application is related to British Patent Application entitled "Method for Accessing Banks of DRAM" as U.K. Serial No. 9415391.3 filed on Jul. 29, 1994 and British Patent Application entitled "Video Decompression" as U.K. Serial No. 9405914.4 filed on Mar. 24, 1994 and British Patent Application entitled "Method and Apparatus for Interfacing with RAM" as U.K. Serial No. 9503964.0 filed on Feb. 28, 1995.

BACKGROUND

This invention relates to Random Access Memory (RAM), and more particularly, to a method for accessing different banks of dynamic RAM. One of the most popular types of RAM is Dynamic Random Access Memory (DRAM). Much attention has been paid to methods for accessing (reading from or writing to) DRAMs. The main concern is speed of access. The dominant limitation on access speed is the need to precharge the RAM before starting an access.

Access speed is greatly increased by accessing more of the RAM using a single precharge, a technique called page mode addressing. In page mode addressing, a block of data words (two or more) has the same row address for each word. Accessing the block involves charging only the column addresses of the data words in the block, not the fixed row address, thus saving on the need to precharge before continuing the access.

Refreshing and precharging in a timely and efficient manner is accomplished by interleaving blocks of data into two separate banks of DRAMS. In this manner, while one DRAM bank is being accessed, the other bank could be safely refreshed or precharged, thereby eliminating (or at least reducing) dead time. Ideally, data would be accessed from the one bank in blocks long enough that refreshing or precharging of the other bank could be finished. In practice, however, this does not always occur because RAM memory systems typically lack a provision for selecting which particular bank to refresh.

These two methods can be combined, as disclosed in U.S. Pat. No. 5,274,788. This patent discloses a RAM memory system in which contiguous memory address locations are interleaved, on a single page basis, between two DRAM banks.

While the combined technique of '788 patent is generally adequate, it is most effective when handling access to a linear sequence of data blocks that are read out of DRAM in essentially the same order as they were written into the DRAM (e.g., cache memory systems). In some applications, however, data blocks are actually related to each other in two (or more) dimensions (e.g., digital video). There is therefore a need for a memory system that interleaves between banks in a manner that takes into account the multi-dimensional relationship between the data blocks.

SUMMARY OF THE INVENTION

This invention discloses a method for accessing Dynamic Random Access Memory (DRAM) to store and retrieve data words associated with a two dimensional image. The DRAM includes two separate banks, a first bank and a second bank. Each bank is capable of operating in page mode to read and write the data words. The two dimensional image is organized in a two dimensional grid pattern of cells, each cell containing an M by N matrix of pixels. The words associated with each cell occupy one page or less of a bank. Each cell is assigned a particular one of the two banks so that all data words associated with that particular cell are read from and written to one particular page of that particular bank. The assignment of banks to cells is done such that each cell is associated with a different bank than any bordering cell which is also either in the same row or in the same column. There is then read the data words associated with a cell that is composed of a matrix of pixels, and that is not aligned with the two dimensional grid pattern, but that is aligned with pixels in cells in the two dimensional grid pattern.

In accordance with another aspect of the invention, the data words associated with the unaligned cell are read by first reading, from the first bank of DRAM, the data words associated with one of the cells in the grid pattern identified as containing data words associated with the unaligned cell. Then there are read, from the second bank of DRAM, the data words associated with another of the cells in the grid pattern containing data words associated with the unaligned cell. Alternate readings between the first and second banks are continued until all the data words associated with the unaligned cell have been read.

In accordance with another aspect of the invention, the data words associated with the unaligned cell are read by first reading, in a predetermined order of cells, the data words associated with each cell in the grid pattern containing data words associated with the unaligned cell. The predetermined order of cells is chosen such that data words read from succeeding cells are read from alternating banks.

In accordance with another aspect of the invention, the predetermined order is a clockwise rotation of cells in the grid pattern identified as containing data words associated with the unaligned cell. Alternately, the predetermined order is a counterclockwise rotation of cells in the grid pattern identified as containing data words associated with the unaligned cell.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 depicts an image, displayed on a television or monitor screen, composed of cells that are aligned in a rectangular grid, and one unaligned cell superimposed over the aligned cells.

FIG. 2 depicts the arrangement of pixels within each cell of FIG. 1, each cell being an exemplary eight pixel by eight pixel block.

FIG. 3 depicts data words representing each pixel of FIG. 2.

FIG. 4 depicts the relationship between an unaligned cell and the pixels in underlying aligned cells.

FIG. 5 is a pictorial diagram mapping the cells of FIGS. 1 or 4 onto the RAM banks of FIG. 6.

FIG. 6 is a block diagram of a RAM system having two banks of RAM and used to store data words of FIG. 3.

FIG. 7 is a pictorial representation of a video decoder that includes the RAM system of FIG. 6, and provides digital video to the screen of FIG. 1.

FIG. 8 depicts a cell of FIGS. 1 or 4 being further partitioned into subcells, and the relationship between subcells and the RAM banks of FIG. 6.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

Referring now to FIGS. 1, 2, and 7, FIG. 7 shows a video monitor 2 having a display screen 6 suitable for displaying images 8 rendered from digital video 4. The source of digital video 4 is video decoder 5. Video decoder 5 includes suitable decoding circuitry (not shown). Video decoder 5 decodes encoded video 9. Typical sources of encoded video 9 include CD or laser disc player 7, or cable television hook-up 3. In FIG. 1 there is shown a portion of a display screen 6, including image 8. Images such as image 8 are composed of pixels 14 (FIG.2). Typically pixels 14 are grouped into cells 12. By grouping pixels 14 into cells 12, the digital video 4 representing image 8 (as well as the rest of display screen 6) can be manipulated (e.g., compressed) more efficiently.

While cells 12 could be arranged in any repeating pattern, typically cells 12 are arranged in the pattern of a rectilinear grid 9. The pattern of grid 9 extends across display screen 6. Within each cell 12, pixels 14 typically are arranged in a square matrix of N rows by N columns. For example, in FIG. 2 cell 12 consists of eight row by eight columns of pixels 14. Associated with each pixel 14 is an identifying position number 13 (from 0 to 63). Alternately, pixels 14 could be grouped in a non-square matrix (i.e., M rows by N columns, where M does not equal N).

Referring now to FIGS. 1, 2, and 3, digital video 4 includes a number of data words 15. In the MPEG digital video standard, six data words 15 are required to represent each region of four pixels 14: One word 15 represents Cb, one word 15 represents Cr, and four words 15 represent Y (luminance).

Referring now to FIGS. 1, 3, 6 and 7, video decoder 5 includes RAM system 30. RAM system 30 is the memory video decoder 5 uses to store data words 15. Video decoder 5 reads words 15 from RAM system 30 in the course of creating, displaying, and manipulating image 8 on screen 6. RAM system 30 includes interleaver 34 and two banks 32 of RAM, bank0 32-0 and bank1 32-1. Interleaver 34 connects banks 32 to the portion (not shown) of video decoder 5 that is used to create, display, and manipulate images 8. In banks 32, data words 15 are stored in pages 33, which are represented in FIG. 6 as overlapping rectangles. A typical size for a page 33 is 1024 eight bit words.

Referring now to FIGS. 1, 2 and 4, one requirement of video decoder 5 is the ability to read a cell 22 that is not aligned to the existing cell grid 9. Instead, cell 22 is aligned to pixels 14 within cells 12. This ability to read unaligned cells 22 is required for searching image 8 for features, or for detecting motion between successive images 8.

Referring now to FIGS. 1 and 4, in FIG. 1 there is shown a cell 22-1 to be read from RAM system 30. Cell 22-1 is not aligned with grid 9, but is aligned to the pixels 14 of cells 12. Cell 22-1 is shown in dotted lines, and can be seen to overlap four cells 12, 12-5, 12-6, 12-7, and 12-8.

In FIG. 4 there is shown a more detailed representation of how unaligned read cell 22-1 overlaps underlying cells 12-5, 12-6, 12-7 and 12-8. The numbers within cell 22-1 represent the numbers 13 of the pixels 14 at the boundary between cell 22-1 and each underlying cell 12. Note that unaligned read cell 22-1 largely consists of pixels 14 drawn from a single underlying cell 12-5. The number of pixels 14 drawn from cells 12-6, 12-8, and 12-7 are seven, seven and one, respectively. Forty-nine pixels are drawn from cell 12-5.

In FIGS. 1 and 4, rectilinear grid 9 is shown without showing how pages 33 containing the data words 15 representing each cell 12 are interleaved. Conceivably the respective pages 33 associated with all of the cells 12 underneath a particular unaligned read cell 22 could be in the same bank 32 of RAM system 30. If so, creating the unaligned read cell 22 would, in the worst case, involve accessing four pages 33 from the same bank 32, a process that requires dead time to precharge that bank 32 three times. For all unaligned cells 22 on image 8, the worst case must appear: Searching or matching do not specify where unaligned cell 22 is, and hence can always be the worst case.

Much better than accessing four pages 33 from the same bank 32 is to access two pages 33 from each bank 32, a process that maximizes interleaving possibilities. The question now becomes how to deal with cases like the example of FIG. 4, in which most of the pixels 14 of the unaligned read cell 22-1 are drawn from a single underlying cell 12-5, leaving little time to precharge while performing the relatively short reads needed to read data from the pages 33 associated with the other three underlying cells 12-6, 12-7 and 12-8. Another difficult case has the unaligned read cell 22 overlying substantial portions of two cells 12, and insubstantial portions of another two cells 12.

In accordance with the invention, the problem of relatively short read times is reduced by interleaving in a particular two-dimensional pattern 40 the pages 33 associated with cells 12.

Referring now to FIGS. 5 and 6, in FIG. 5 half of the cells 12 are shown with hatching 39, and half of the cells 12 lack hatching 39. The presence of hatching 39 on a cell 12 signifies that the page 33 associated with that particular cell 12 resides in bank0 32-0. The absence of hatching 39 on a cell 12 signifies that the page 33 associated with that particular cell 12 resides in bank1 32-1. For example, cell 12-6 is shown hatched, so the page 33 associated with the data words 15 that describe cell 126 are stored in bank0 32-0, and so must be read from bank0 32-0.

In accordance with the invention, the problem of relatively short read times is reduced by having interleaver 34 interleave pages 33 into banks 32 based on a particular two dimensional pattern 40 of cells 12 associated with pages 33. As shown in FIG. 5, pattern 40 resembles a checkerboard: No two sequential cells 12 in the same row of grid 9 have their associated page 33 in the same bank 32, and no two sequential cells 12 in the same column of grid 9 have their associated page 33 in the same bank 32. Checkerboard pattern 40 maximizes interleave possibilities by ensuring that when unaligned read cell 22 overlies four cells 12, the pages 33 of two of the overlaid cells 12 are stored in one bank 32, while the pages 33 associated with the other two overlaid cells 12 are stored in the other bank 32. For example, in FIG. 5, cells 12-5 and 12-7 have their associated pages 33 stored in bankl 32-1, while cells 12-6 and 12-8 have their associated pages 33 stored in bank0 32-0.

For maximum interleave efficiency, pages 33 should be read from alternate banks 32. This is ensured by reading from the four cells 12 underlying an unaligned read cell 22 in either a clockwise order, or in a counter-clockwise order. As an example of the method of reading in the clockwise direction, consider the four cells 12 underlying cell 22-1 in FIG. 5. First, the page 33 associated with cell 12-5 would be read from bank1 32-1 by interleaver 34. Then the page 33 associated with cell 12-6 would be read, since cell 12-6 is positioned in the same row as cell 12-5, and to the right of cell 12-5. Next the page 33 associated with cell 12-7 would be read, since cell 12-7 is in the same column as cell 12-6, and below cell 12-6. Finally the page 33 associated with cell 12-8 would be read, since cell 12-8 is in the same row as cell 12-7, and to the left of cell 12-7.

Simulations have shown that the checkerboard pattern 40 of interleaving banks 32 reduces dead time. The aspect ratio and size of checkerboard pattern 40 can be selected to be optimum for the particular application. The only requirement is that at least one cell 12 underlying an unaligned read cell 22 is represented by less than one page 33 of words 15. In this manner, each of the four possible reads of underlying cells 12 is self-contained, limiting the interleaving to the mechanism described. Any further fragmentation would involve a more complex interleaving algorithm and would cause longer dead times.

Note that sometimes each pair of possible reads of underlying cells 12 contains words 15 in the same page 33 (e.g., words 15 from cells 12-6 and 12-8 underlying unaligned read cell 22-1 many be contained on the same page 33). Therefore the reading of words 15 from pages 33 could be further optimized. However, the worst case scenario remains.

The method of the present invention can also be applied, with out any loss in performance, to cells 12 having dimensions (M by N) that require more data words 15 than can be stored in a single page 33. Referring now to FIGS. 6 and 8, such a cell 12 is divided by subgrid 52 into subcells 50, with the dimensions of subcells 50 chosen so that the number of words 15 associated with each subcell 50 can be stored in a single page 33. As shown in FIG. 8, the same checkerboard pattern 40 can be applied to subcells 50 (e.g., subcells 50-1 and 50-3 stored in the same bank 32, and subcells 50-2 and 50-4 stored in the same bank 32), allowing the accessing of words 15 associated with each "oversized" cell 12 to be managed in the same efficient manner as cells 12 themselves are managed.

While the invention has been described with reference to the structures and methods disclosed, it is not confined to the specific details set forth, but is intended to cover such modifications or changes as may come within the scope of the following claims. 

We claim:
 1. A method for accessing Dynamic Random Access Memory (DRAM) to store and retrieve data words associated with a two dimensional image, the DRAM including two separate banks, each bank being capable of operating in page mode to read and write the data words, the two dimensional image being organized in a two dimensional grid pattern of cells, each cell containing an M by N matrix of pixels, and the words associated with each cell occupying one page or less of a bank, the method comprising the steps of:(a) assigning each cell a particular one of the two banks so that all data words associated with that particular cell are read from and written to one particular page of that particular bank, the assignment of banks to cells being done such that each cell is associated with a different bank than any bordering cell which is also either in the same row or in the same column; (b) reading the data words associated with a cell that is composed of an M by N matrix of pixels, and that is not aligned with the two dimensional grid pattern, but that is aligned with pixels in cells in the two dimensional grid pattern by the steps of (c) reading, from the first bank of DRAM, the data words associated with one of the cells in the grid pattern containing data words associated with the unaligned cell; (d) immediately thereafter, reading, from the second bank of DRAM, the data words associated with another of the cells in the grid pattern containing data words associated with the unaligned cell; (e) repeating steps (c) and (d) until all the data words associated with the unaligned cell have been read.
 2. The method of claim 1, wherein the DRAM includes a first and a second bank, and the step (b) of reading the data words associated with the unaligned cell includes the steps of:(d) reading, in a predetermined order of cells, the data words associated with each cell in the grid pattern containing data words associated with the unaligned cell, the predetermined order of cells resulting in data words read from succeeding cells being read from alternating banks.
 3. The method of claim 2, wherein the predetermined order is a clockwise rotation of cells in the grid pattern containing data words associated with the unaligned cell.
 4. The method of claim 2, wherein the predetermined order is a counter-clockwise rotation of cells in the grid pattern containing data words associated with the unaligned cell.
 5. The method of claim 1, wherein the DRAM includes a first and a second bank, and the step (b) of reading the data words associated with the unaligned cell includes the steps of:(c) identifying which cells in the two dimensional grid pattern contain data words associated with the unaligned cell; (d) reading, from the first bank of DRAM, the data words associated with one of the cells in the grid pattern identified as containing data words associated with the unaligned cell; (e) reading, from the second bank of DRAM, the data words associated with another of the cells in the grid pattern identified as containing data words associated with the unaligned cell; (f) repeating steps (d) and (e) until all the data words associated with the unaligned cell have been read.
 6. The method of claim 1, wherein the DRAM includes a first and a second bank, and the step (b) of reading the data words associated with the unaligned cell includes the steps of:(c) identifying which cells in the two dimensional grid pattern contain data words associated with the unaligned cell; (d) reading, in a predetermined order of cells, the data words associated with each cell in the grid pattern identified as containing data words associated with the unaligned cell, the predetermined order of cells resulting in data words read from succeeding cells being read from alternating banks.
 7. The method of claim 6, wherein the predetermined order is a clockwise rotation of cells in the grid pattern identified as containing data words associated with the unaligned cell.
 8. The method of claim 6, wherein the predetermined order is a counter-clockwise rotation of cells in the grid pattern identified as containing data words associated with the unaligned cell. 